package com.example.lib_net.interceptor

import android.os.Build
import com.example.lib_storage.AuthMMKV
import okhttp3.Interceptor
import okhttp3.Response

/**
 * @author yaotianxue
 * @description 自定义请求头拦截器
 * @date 2025/1/13
 */
class HttpHeaderInterceptor:Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
       val newRequest = chain.request().newBuilder()
            .addHeader("Content-Language","zh_CN")//BuildConfig
            .addHeader("platform","ANDROID")
            .addHeader("source","CLUB_APP")
            .addHeader("Authorization",AuthMMKV.token)//token
            .addHeader("meid","ai0d75be6be8db1f85ef1768a0157815ed")
            .addHeader("version","1.1.5") //BuildConfig
            .addHeader("phoneModel", Build.BRAND+"_"+Build.MODEL)
            .build()
        return chain.proceed(newRequest)
    }
}